package com.zw.yzk.kabu.data.repository;

import com.zw.yzk.kabu.data.network.task.Task;
import com.zw.yzk.kabu.data.network.ServiceGenerator;
import com.zw.yzk.kabu.data.network.entity.GoodsClassifyEntity;
import com.zw.yzk.kabu.data.network.service.GoodsClassifyService;

import javax.inject.Inject;

import rx.Observable;
import rx.functions.Func1;

/**
 * Created by zhanwei on 2017/1/12.
 */

public class GoodsClassifyRepository extends CommonRepository {

    @Inject
    public GoodsClassifyRepository() {
    }


    @Override
    protected Observable connectServer(Task task) {
        GoodsClassifyService service = ServiceGenerator.createService(GoodsClassifyService.class);

        return service.getGoodsClassify();
    }

    @Override
    protected Func1<GoodsClassifyEntity, Observable> getServerData() {
        return new Func1<GoodsClassifyEntity, Observable>() {
            @Override
            public Observable call(GoodsClassifyEntity entity) {
                return Observable.just(entity);
            }
        };
    }

}
